package com.k9sv.dao.impl;

import java.io.Serializable;
import java.util.List;

import com.k9sv.dao.IBaseDao;

public class BaseDao implements IBaseDao {

	protected PojoManager pojoManager;
	
	@Override
	public <T> T save(T paramT) throws Exception {
			
		return (T) pojoManager.save(paramT);
	}

	@Override
	public <T> T getByClassId(Class<? extends T> clazz, Serializable id)
			throws Exception {
		return (T) pojoManager.getByClassId(clazz, id);
	}

	@Override
	public <T> void delete(T entity)
			throws Exception {
		pojoManager.delete(entity);

	}

	@Override
	public <T> void merge(T entity)
			throws Exception {
		pojoManager.merge(entity);

	}

	@Override
	public <T> void update(T entity)
			throws Exception {
		pojoManager.update(entity);

	}

	@Override
	public <T> List<T> query(String query, Object[] values, int start,
			int size) throws Exception {
		return pojoManager.query(query, values, start, size);
	}

	@Override
	public Object getCount(String where, Object[] values) throws Exception {
			return pojoManager.getCount(where, values);
	}

	public PojoManager getPojoManager() {
		return pojoManager;
	}

	public void setPojoManager(PojoManager pojoManager) {
		this.pojoManager = pojoManager;
	}

}
